import {request} from "./request.js"

/* 创建矿池信息 */
export function createPoolInfo(data = {
	pool_name: '',
	public_key: '',
	wallet: '',
	current_tib: '',
	total_tib: ''
}) {
	return request({
		url: '/api/pool/pools/',
		method: 'post',
		data: data
	})
}

/* 修改矿池信息 */
export function updatePoolInfo(id, data = {
	pool_name: '',
	public_key: '',
	wallet: '',
	current_tib: '',
	total_tib: ''
}) {
	return request({
		url: `/api/pool/pools/${id}/`,
		method: 'put',
		data: data
	})
}

/* 获取矿池信息列表 */
export function getPoolInfoList() {
	return request({
		url: `/api/pool/pools/`,
		method: 'get'
	})
}

/* 矿池资产 */
export function assetPool(method = 'get', data = {}) {
	return request({
		url: '/api/pool/rewards/',
		method: method,
		data: data
	})
}

/* 矿池钱包 */
export function walletPool(method = 'get', data = {}) {
	return request({
		url: '/api/pool/wallet/',
		method: method,
		data: data
	})
}

export function walletPoolPut(data = {}) {
	return request({
		url: `/api/pool/wallet/${data.id}/`,
		method: 'put',
		data: data
	})
}

/* 提币报表 */
export function drawMoney(method = 'get', data = {}) {
	return request({
		url: '/api/pool/withdrawreport/',
		method: method,
		data: data
	})
}

/* 矿池交易记录 */
export function dealRecordPool(method = 'get', data = {}) {
	return request({
		url: '/api/pool/transaction/',
		method: method,
		data: data
	})
}

/* 钱包资产 */
export function walletAsset(method = 'get', data = {}) {
	return request({
		url: '/api/pool/walletasset/',
		method: method,
		data: data
	})
}